<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Bomberman:  Fichier source de /home/ph3w/Bureau/lif7-bomberman/moteur_ncurses.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Généré par Doxygen 1.7.1 -->
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
<div class="header">
  <div class="headertitle">
<h1>/home/ph3w/Bureau/lif7-bomberman/moteur_ncurses.h</h1>  </div>
</div>
<div class="contents">
<a href="moteur__ncurses_8h.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef MOTEUR_NCURSES_h</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define MOTEUR_NCURSES_h</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;string.h&gt;</span><span class="comment">// Pour strlen()</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="partie_8h.html">partie.h</a>&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="config_8h.html">config.h</a>&quot;</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="comment">/* curses.h</span>
<a name="l00010"></a>00010 <span class="comment">    COLOR_BLACK     0</span>
<a name="l00011"></a>00011 <span class="comment">    COLOR_RED       1</span>
<a name="l00012"></a>00012 <span class="comment">    COLOR_GREEN     2</span>
<a name="l00013"></a>00013 <span class="comment">    COLOR_YELLOW    3</span>
<a name="l00014"></a>00014 <span class="comment">    COLOR_BLUE      4</span>
<a name="l00015"></a>00015 <span class="comment">    COLOR_MAGENTA   5</span>
<a name="l00016"></a>00016 <span class="comment">    COLOR_CYAN      6</span>
<a name="l00017"></a>00017 <span class="comment">    COLOR_WHITE     7 // GRIS BLANC</span>
<a name="l00018"></a>00018 <span class="comment">    // OUT OF CURSES</span>
<a name="l00019"></a>00019 <span class="comment">    8 = GRIS</span>
<a name="l00020"></a>00020 <span class="comment">    9 = BLEU</span>
<a name="l00021"></a>00021 <span class="comment">    10 = vert, claire</span>
<a name="l00022"></a>00022 <span class="comment">    11 = bleu, claire</span>
<a name="l00023"></a>00023 <span class="comment">    12 = rouge, claire</span>
<a name="l00024"></a>00024 <span class="comment">    13 = violet, claire</span>
<a name="l00025"></a>00025 <span class="comment">    14 = jaune, claire</span>
<a name="l00026"></a>00026 <span class="comment">    15 = blanc</span>
<a name="l00027"></a>00027 <span class="comment">*/</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="comment">// Couleurs Multiplexées</span>
<a name="l00030"></a>00030 <span class="preprocessor">#define MU_YELLOW_BLACK 1</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define MU_RED_BLACK 2</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define MU_BLUE_BLACK 3</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define MU_GREEN_BLACK 4</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define MU_WHITE_BLACK 5</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define MU_BLACK_YELLOW 6</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define MU_BLACK_MAGENTA 7</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span>
<a name="l00038"></a>00038 <span class="comment">// Couleur des joueurs</span>
<a name="l00039"></a>00039 <span class="preprocessor">#define MU_JOUEUR1 3</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define MU_JOUEUR2 2</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define MU_JOUEUR3 4</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define MU_JOUEUR4 1</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span>
<a name="l00044"></a>00044 <span class="comment"></span>
<a name="l00045"></a>00045 <span class="comment">/*!</span>
<a name="l00046"></a>00046 <span class="comment">* @class moteur_ncurses</span>
<a name="l00047"></a>00047 <span class="comment">* @brief Gère l&#39;affichage via le moteur &quot;graphique&quot; NCurses</span>
<a name="l00048"></a>00048 <span class="comment">*</span>
<a name="l00049"></a>00049 <span class="comment">* @note Aucune variable n&#39;est membre de ce module</span>
<a name="l00050"></a>00050 <span class="comment">*/</span>
<a name="l00051"></a><a class="code" href="classmoteur__ncurses.html">00051</a> <span class="keyword">class </span><a class="code" href="classmoteur__ncurses.html" title="Gère l&amp;#39;affichage via le moteur &amp;quot;graphique&amp;quot; NCurses.">moteur_ncurses</a>
<a name="l00052"></a>00052 {
<a name="l00053"></a>00053     <span class="keyword">private</span>:
<a name="l00054"></a><a class="code" href="classmoteur__ncurses.html#a80ff5f97779c081cf278601e0e77757a">00054</a>         <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmoteur__ncurses.html#a80ff5f97779c081cf278601e0e77757a">c_premierAffichage</a>;
<a name="l00055"></a>00055 
<a name="l00056"></a>00056     <span class="keyword">private</span>:
<a name="l00057"></a>00057         <span class="keywordtype">void</span> <a class="code" href="classmoteur__ncurses.html#aa5d8fae6272f29e7fc0981a988b71a49" title="Affiche un cadre au tour (interieur) de la fenêtre.">cadre</a>();
<a name="l00058"></a>00058         <span class="keywordtype">void</span> <a class="code" href="classmoteur__ncurses.html#a4e1ecb3c99e46d3088caff0d4c57e1f3" title="Affiche une touche. Si nécessaire, un affichage spécifique est fait.">affichageTouche</a>( WINDOW* win, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> key );
<a name="l00059"></a>00059         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classmoteur__ncurses.html#a208a8f8e69a8bcfe2fe3b01291195d1c" title="Permet d&amp;#39;effacer une ligne.">cleanline</a>( WINDOW* win, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> x_begin, <span class="keywordtype">int</span> x_end );
<a name="l00060"></a><a class="code" href="classmoteur__ncurses.html#a6df6bd2e3e0477715282266b6f830c68">00060</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmoteur__ncurses.html#a6df6bd2e3e0477715282266b6f830c68" title="Alias de cleanline( win, y, 1, getmaxx(win)-2 );.">cleanline</a>( WINDOW* win, <span class="keywordtype">int</span> y ){ <a class="code" href="classmoteur__ncurses.html#a6df6bd2e3e0477715282266b6f830c68" title="Alias de cleanline( win, y, 1, getmaxx(win)-2 );.">cleanline</a>( win, y, 1, getmaxx(win)-2 ); }
<a name="l00061"></a>00061         <span class="keyword">static</span> chtype <a class="code" href="classmoteur__ncurses.html#a4c23b0d0242fcc5f3c90c8162112559d" title="Renvoie la couleur d&amp;#39;un joueur.">getCouleurJoueur</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> joueur );
<a name="l00062"></a>00062 
<a name="l00063"></a>00063     <span class="keyword">public</span>:
<a name="l00064"></a>00064         <a class="code" href="classmoteur__ncurses.html#adfdc27c0e515a91a72146f93c91ccbe6" title="Initialise la class moteur_ncurses.">moteur_ncurses</a>();
<a name="l00065"></a>00065         <a class="code" href="classmoteur__ncurses.html#a9dd6bbae39e6224f1f88e27b4b23b969" title="Désinitialise la class moteur_ncurses.">~moteur_ncurses</a>();
<a name="l00066"></a>00066 
<a name="l00067"></a>00067         <span class="comment">// Fonction d&#39;affichage de menu</span>
<a name="l00068"></a>00068         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classmoteur__ncurses.html#ade52341b4b08a8eca9ee3c81c01abe7c" title="Créé une sous fenêtre centré.">menu</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> titre[], <span class="keyword">const</span> <span class="keywordtype">char</span> *choix[], <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nb_choix );
<a name="l00069"></a>00069         <span class="keywordtype">void</span> <a class="code" href="classmoteur__ncurses.html#a5a5da4538be5bc5b7e78cc7f96d2f6a8" title="Menu permettant d&amp;#39;afficher et de modifier la configuration du clavier d&amp;#39;un joueur...">afficherConfigurationClavier</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> joueur );
<a name="l00070"></a>00070         <span class="keywordtype">int</span> <a class="code" href="classmoteur__ncurses.html#a1d09cbe9608be4025643c0e7db9a0069" title="Créer un menu pour récupérer un nombre entré par un utilisateur.">getNombre</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> titre[], <span class="keywordtype">int</span> valeurParDefaut, <span class="keywordtype">int</span> valeurMin, <span class="keywordtype">int</span> valeurMax, <span class="keywordtype">int</span>* returnValue );
<a name="l00071"></a>00071         <span class="keywordtype">int</span> <a class="code" href="classmoteur__ncurses.html#a20d01f1da6e4e378673df3f550e57bae" title="Permet d&amp;#39;obtenir du texte.">getTexte</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> titre[], <span class="keywordtype">char</span> texteRetour[21] );
<a name="l00072"></a><a class="code" href="classmoteur__ncurses.html#a7d67a62cc712313d3039d96711a0581d">00072</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classmoteur__ncurses.html#a7d67a62cc712313d3039d96711a0581d">isWindowOpen</a>(){ <span class="keywordflow">return</span> <span class="keyword">true</span>; }
<a name="l00073"></a>00073 
<a name="l00074"></a>00074         <span class="comment">// Modificateur</span>
<a name="l00075"></a><a class="code" href="classmoteur__ncurses.html#aadccb49d9c68b26a71686e7478b64ca7">00075</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmoteur__ncurses.html#aadccb49d9c68b26a71686e7478b64ca7" title="Permet de forcer un affichage complet.">forcerRafraichissement</a>() { <a class="code" href="classmoteur__ncurses.html#a80ff5f97779c081cf278601e0e77757a">c_premierAffichage</a> = 1; }
<a name="l00076"></a>00076 
<a name="l00077"></a>00077         <span class="comment">// Autres :: Affichage map</span>
<a name="l00078"></a>00078         <span class="keyword">static</span> SYS_CLAVIER <a class="code" href="classmoteur__ncurses.html#a4befeea46ae3cc1fd4fa76164f02a8c2" title="Affiche une map.">afficherMapEtEvent</a>( <a class="code" href="classpartie.html" title="Permet de gérer une partie offline ou online ( host et client ).">partie</a>* p );
<a name="l00079"></a>00079 };
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Généré le Fri Jan 21 2011 01:21:27 pour Bomberman par&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
